projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
382153e
)
gtk-demo: Fix a crash in the puzzle
author
Matthias Clasen
<mclasen@redhat.com>
Mon, 1 Jun 2020 04:10:42 +0000
(
00:10
-0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Mon, 1 Jun 2020 04:11:50 +0000
(
00:11
-0400)
Avoid a crash when clicking the refresh button
after solving the puzzle.
demos/gtk-demo/sliding_puzzle.c
patch
|
blob
|
history
diff --git
a/demos/gtk-demo/sliding_puzzle.c
b/demos/gtk-demo/sliding_puzzle.c
index 925d9817642b75559124c494f015ffe4c5fdce76..c7897f2dfdb02ebbebb005f589f3a520a56fe069 100644
(file)
--- a/
demos/gtk-demo/sliding_puzzle.c
+++ b/
demos/gtk-demo/sliding_puzzle.c
@@
-355,11
+355,16
@@
reshuffle (void)
{
GtkWidget *grid;
- grid = gtk_aspect_frame_get_child (GTK_ASPECT_FRAME (frame));
if (solved)
- start_puzzle (puzzle);
+ {
+ start_puzzle (puzzle);
+ grid = gtk_aspect_frame_get_child (GTK_ASPECT_FRAME (frame));
+ }
else
- shuffle_puzzle (grid);
+ {
+ grid = gtk_aspect_frame_get_child (GTK_ASPECT_FRAME (frame));
+ shuffle_puzzle (grid);
+ }
gtk_widget_grab_focus (grid);
}